
             
/**
 * 
 *
 * @File name:  AddTPersonnalAction.java   添加【人员信息:T_PERSONNAL】
 * @Create on:  2011-10-30 23:38:947
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        
package com.boho.estates.staff.action;

            
import java.sql.Connection;

import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.exception.UserOperationException;
import cn.boho.framework.po.POUtils;
import cn.boho.framework.service.MessageService;

import com.boho.common.SystemUtils;
import com.boho.estates.po.TPersonnalPO;

public class AddTPersonnalAction extends ActionImp {
	private TPersonnalPO tPersonnalPO = new TPersonnalPO();
	private Connection con=null;
	@Override
	protected void doException(ActionContext atx, Exception ex) {
		if (!(ex instanceof UserOperationException)) {
			atx.setErrorContext("BOHO_COMMON_1001", MessageService.getMessage("BOHO_COMMON_1001"),"【人员信息】", ex);
		}
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		POUtils.insert(con, tPersonnalPO,false);
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		con = atx.getConection();
		String createBy = SystemUtils.getSessionUser(atx);
		tPersonnalPO.setName(atx.getStringValue("NAME"));
		tPersonnalPO.setDepartmentNo(atx.getIntegerValue("DEPARTMENT_NO"));
		tPersonnalPO.setSex(atx.getStringValue("SEX"));
		tPersonnalPO.setPosition(atx.getStringValue("POSITION"));
		//tPersonnalPO.setJionDate(atx.getStringValue("JION_DATE"));
		tPersonnalPO.setTelephone(atx.getStringValue("TELEPHONE"));
		tPersonnalPO.setRemark(atx.getStringValue("REMARK"));
		tPersonnalPO.setCreateBy(createBy);
		tPersonnalPO.setCreateDate(new java.util.Date());
		return 1;
	}
}
